package cn.wolfcode.plus.uilt;

import lombok.*;

@Getter
@Setter
@ToString
public class AjaxResult {
    private Integer code;
    private String msg;
    private Object data;

    public AjaxResult() {
    }

    public AjaxResult(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static AjaxResult success(){
        return new AjaxResult(200,"操作成功",null);
    }

    public static AjaxResult success(Object data){
        return new AjaxResult(200,"操作成功",data);
    }

    public static AjaxResult error(){
        return new AjaxResult(500,"操作失败",null);
    }


}
